﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AnyCAD.Forms;
using AnyCAD.Foundation;
namespace WinForms.NET4
{
    public partial class Form1 : Form
    {
        RenderControl mRenderView;
        public Form1()
        {
            InitializeComponent();
            mRenderView = new RenderControl(this.panel1);
            mRenderView.ViewerReady += MRenderView_ViewerReady;
        }

        private void MRenderView_ViewerReady()
        {
            var shape = ShapeBuilder.MakeBox(new GAx2(), 10, 20, 30);
            var node = mRenderView.ShowShape(shape, new Vector3(1));

            //var material = MeshPhongMaterial.Create("xxx");
            //material.SetColor(new Vector3(1, 0, 0));
            //node.SetFaceMaterial(0, material);
            node.SetFaceColor(0, new Vector3(1, 0, 0));
        }
    }
}
